-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report the count of files in the Worst and Offense Count formatters #11113
Report the count of files in the Worst and Offense Count formatters #11113
Conversation
267e532
to
47c0362
Compare
output.puts '--' | ||
output.puts "#{total_count} Total" | ||
output.puts "#{total_count} Total offenses in #{file_count} offending files" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the word "offending" is redundant here, given the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had written it initially without "offending", but it felt a bit ambiguous: was this the total number of processed files, or the number of files with offenses?
I'm not worried too much, though, so I'm ok either way. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here it should be quiet clear from the context, so probably less is more. Even the word "offenses" is kind of redundant IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it to show 3 Total in 2 files
.
…ormal usage These specs called `file_finished` for one file only, even though the test sets up multiple files. The method is now called for each file.
f516429
to
c0763f1
Compare
Thanks! |
Follow up #11113. This commit fies the following build error. ```console ==> Failures 1) RuboCop::CLI for a disabled cop reports no offense when enabled on part of a file Failure/Error: expect($stdout.string).to eq(<<~RESULT) -- 0 Total RESULT expected: "\n--\n0 Total\n\n" got: "\n--\n0 Total in 0 files\n\n" (compared using ==) Diff: @@ -1,4 +1,4 @@ -- -0 Total +0 Total in 0 files # ./spec/rubocop/cli_spec.rb:302:in `block (3 levels) in <top (required)>' # ./spec/support/cli_spec_behavior.rb:26:in `block (2 levels) in <top (required)>' ```
Update the sample output for the Offense Count and the Worst Offenders formatters to match the changes in rubocop#11113.
Report the count of files in the Worst and the Offence Counts formatters. Their output now looks like this:
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.